<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ESP32 HTTPS Server: httpsserver::ResourceParameters Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP32 HTTPS Server
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classhttpsserver_1_1ResourceParameters.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classhttpsserver_1_1ResourceParameters-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">httpsserver::ResourceParameters Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The <a class="el" href="classhttpsserver_1_1ResourceParameters.html" title="The ResourceParameters provide access to the parameters passed in the URI. ">ResourceParameters</a> provide access to the parameters passed in the URI.  
 <a href="classhttpsserver_1_1ResourceParameters.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="ResourceParameters_8hpp_source.html">ResourceParameters.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad9418179f1ad08593ec0801af1888d5c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1ResourceParameters.html#ad9418179f1ad08593ec0801af1888d5c">isQueryParameterSet</a> (std::string const &amp;name)</td></tr>
<tr class="memdesc:ad9418179f1ad08593ec0801af1888d5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks whether a specific HTTPS query parameter is set.  <a href="#ad9418179f1ad08593ec0801af1888d5c">More...</a><br /></td></tr>
<tr class="separator:ad9418179f1ad08593ec0801af1888d5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1c5d9ddfe5de7ab11c7d198c2929beb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1ResourceParameters.html#ae1c5d9ddfe5de7ab11c7d198c2929beb">getQueryParameter</a> (std::string const &amp;name, std::string &amp;value)</td></tr>
<tr class="memdesc:ae1c5d9ddfe5de7ab11c7d198c2929beb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an HTTP query parameter.  <a href="#ae1c5d9ddfe5de7ab11c7d198c2929beb">More...</a><br /></td></tr>
<tr class="separator:ae1c5d9ddfe5de7ab11c7d198c2929beb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05eebf06e0b2fd9a19299c18d322577a"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::pair&lt; std::string, std::string &gt; &gt;::iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1ResourceParameters.html#a05eebf06e0b2fd9a19299c18d322577a">beginQueryParameters</a> ()</td></tr>
<tr class="memdesc:a05eebf06e0b2fd9a19299c18d322577a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides iterator access to the query parameters.  <a href="#a05eebf06e0b2fd9a19299c18d322577a">More...</a><br /></td></tr>
<tr class="separator:a05eebf06e0b2fd9a19299c18d322577a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a957693f8c6d1352da83cf5e0bb100113"><td class="memItemLeft" align="right" valign="top"><a id="a957693f8c6d1352da83cf5e0bb100113"></a>
std::vector&lt; std::pair&lt; std::string, std::string &gt; &gt;::iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1ResourceParameters.html#a957693f8c6d1352da83cf5e0bb100113">endQueryParameters</a> ()</td></tr>
<tr class="memdesc:a957693f8c6d1352da83cf5e0bb100113"><td class="mdescLeft">&#160;</td><td class="mdescRight">Counterpart to <a class="el" href="classhttpsserver_1_1ResourceParameters.html#a05eebf06e0b2fd9a19299c18d322577a" title="Provides iterator access to the query parameters. ">beginQueryParameters()</a> for iterating over query parameters. <br /></td></tr>
<tr class="separator:a957693f8c6d1352da83cf5e0bb100113"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10b58c61c35aa39a839f3876508810d5"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1ResourceParameters.html#a10b58c61c35aa39a839f3876508810d5">getQueryParameterCount</a> (bool unique=false)</td></tr>
<tr class="memdesc:a10b58c61c35aa39a839f3876508810d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of query parameters.  <a href="#a10b58c61c35aa39a839f3876508810d5">More...</a><br /></td></tr>
<tr class="separator:a10b58c61c35aa39a839f3876508810d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a13a88e718c899dcd679a7f874abf8a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1ResourceParameters.html#a1a13a88e718c899dcd679a7f874abf8a">getPathParameter</a> (size_t const idx, std::string &amp;value)</td></tr>
<tr class="memdesc:a1a13a88e718c899dcd679a7f874abf8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks for the existence of a path parameter and returns it as string.  <a href="#a1a13a88e718c899dcd679a7f874abf8a">More...</a><br /></td></tr>
<tr class="separator:a1a13a88e718c899dcd679a7f874abf8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1a6e3f81ff80c51b1034c19d8c1625a"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhttpsserver_1_1ResourceParameters.html#aa1a6e3f81ff80c51b1034c19d8c1625a">getPathParameter</a> (size_t const idx)</td></tr>
<tr class="memdesc:aa1a6e3f81ff80c51b1034c19d8c1625a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Directly returns a path parameter.  <a href="#aa1a6e3f81ff80c51b1034c19d8c1625a">More...</a><br /></td></tr>
<tr class="separator:aa1a6e3f81ff80c51b1034c19d8c1625a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ab6601eed00957d31bf957cc49f3ee857"><td class="memItemLeft" align="right" valign="top"><a id="ab6601eed00957d31bf957cc49f3ee857"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>setQueryParameter</b> (std::string const &amp;name, std::string const &amp;value)</td></tr>
<tr class="separator:ab6601eed00957d31bf957cc49f3ee857"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0adb9169c35d004e89ab8bff07bd526"><td class="memItemLeft" align="right" valign="top"><a id="ac0adb9169c35d004e89ab8bff07bd526"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>resetPathParameters</b> ()</td></tr>
<tr class="separator:ac0adb9169c35d004e89ab8bff07bd526"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab885417b67796ad1fd2977aa7accc01d"><td class="memItemLeft" align="right" valign="top"><a id="ab885417b67796ad1fd2977aa7accc01d"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>setPathParameter</b> (size_t idx, std::string const &amp;val)</td></tr>
<tr class="separator:ab885417b67796ad1fd2977aa7accc01d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:aa8d7cbbf948d2b0e76ac5858913f751a"><td class="memItemLeft" align="right" valign="top"><a id="aa8d7cbbf948d2b0e76ac5858913f751a"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>ResourceResolver</b></td></tr>
<tr class="separator:aa8d7cbbf948d2b0e76ac5858913f751a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="classhttpsserver_1_1ResourceParameters.html" title="The ResourceParameters provide access to the parameters passed in the URI. ">ResourceParameters</a> provide access to the parameters passed in the URI. </p>
<p>There are two types of parameters: Path parameters and query parameters.</p>
<p>Path parameters are the values that fill the asterisk placeholders in the route definition of a <a class="el" href="classhttpsserver_1_1ResourceNode.html" title="This HTTPNode represents a route that maps to a regular HTTP request for a resource (static or dynami...">ResourceNode</a>.</p>
<p>Query parameters are the key-value pairs after a question mark which can be added to each request, either by specifying them manually or as result of submitting an HTML form with a GET as method property. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a05eebf06e0b2fd9a19299c18d322577a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a05eebf06e0b2fd9a19299c18d322577a">&#9670;&nbsp;</a></span>beginQueryParameters()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; std::pair&lt; std::string, std::string &gt; &gt;::iterator httpsserver::ResourceParameters::beginQueryParameters </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Provides iterator access to the query parameters. </p>
<p>Query parameters are key-value pairs that are appended to the URI after a question mark.</p>
<p>If you want just a specific parameter, have a look at <a class="el" href="classhttpsserver_1_1ResourceParameters.html#ae1c5d9ddfe5de7ab11c7d198c2929beb" title="Returns an HTTP query parameter. ">getQueryParameter()</a></p>
<p>The iterator will yield pairs of std::string, of which the first value specifies the query parameter key and the second value corresponds to the query parameters value. If the entry is value-less, the second value will be the empty string.</p>
<p>If the same key is used multiple times in the query, the iterator will yield it multiple times, once for each occurence with the specific value.</p>
<dl class="section return"><dt>Returns</dt><dd>Iterator over std::pairs of std::strings that represent (key, value) pairs </dd></dl>

</div>
</div>
<a id="a1a13a88e718c899dcd679a7f874abf8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a13a88e718c899dcd679a7f874abf8a">&#9670;&nbsp;</a></span>getPathParameter() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool httpsserver::ResourceParameters::getPathParameter </td>
          <td>(</td>
          <td class="paramtype">size_t const&#160;</td>
          <td class="paramname"><em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks for the existence of a path parameter and returns it as string. </p>
<p>Path parameters are defined by an asterisk as placeholder when specifying the path of the <a class="el" href="classhttpsserver_1_1ResourceNode.html" title="This HTTPNode represents a route that maps to a regular HTTP request for a resource (static or dynami...">ResourceNode</a> and addressed by an index starting at 0 for the first parameter.</p>
<p>For values of idx that have no matching placeholder, value is left unchanged and the method will return false.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">idx</td><td>Defines the index of the parameter to return, starting with 0. </td></tr>
    <tr><td class="paramname">value</td><td>The value is written into this parameter. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true iff the value could be written. </dd></dl>

</div>
</div>
<a id="aa1a6e3f81ff80c51b1034c19d8c1625a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa1a6e3f81ff80c51b1034c19d8c1625a">&#9670;&nbsp;</a></span>getPathParameter() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string httpsserver::ResourceParameters::getPathParameter </td>
          <td>(</td>
          <td class="paramtype">size_t const&#160;</td>
          <td class="paramname"><em>idx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Directly returns a path parameter. </p>
<p>Path parameters are defined by an asterisk as placeholder when specifying the path of the <a class="el" href="classhttpsserver_1_1ResourceNode.html" title="This HTTPNode represents a route that maps to a regular HTTP request for a resource (static or dynami...">ResourceNode</a> and addressed by an index starting at 0 for the first parameter.</p>
<p>This method will return the parameter specified by the index. The caller is responsible to assure that the index exists. Otherwise, an empty string will be returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">idx</td><td>Defines the index of the parameter to return, starting with 0. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the value of the placeholder </dd></dl>

</div>
</div>
<a id="ae1c5d9ddfe5de7ab11c7d198c2929beb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1c5d9ddfe5de7ab11c7d198c2929beb">&#9670;&nbsp;</a></span>getQueryParameter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool httpsserver::ResourceParameters::getQueryParameter </td>
          <td>(</td>
          <td class="paramtype">std::string const &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns an HTTP query parameter. </p>
<p>Query parameters are key-value pairs that are appended to the URI after a question mark.</p>
<p>The name parameter specifies the name of the query parameter to retrieve. If it is set, the value is written to the value parameter and true is returned. If the parameter does not exist, value is left unchanged and false is returned. If the parameter is used without a value, an empty string is written to value and true is returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The name of the parameter to retrieve. If the parameter exists multiple times, the first occurence is used for the value. Use <a class="el" href="classhttpsserver_1_1ResourceParameters.html#a05eebf06e0b2fd9a19299c18d322577a" title="Provides iterator access to the query parameters. ">beginQueryParameters()</a> to retrieve all values. </td></tr>
    <tr><td class="paramname">value</td><td>The target to write the value to, if the parameter exists. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true iff the parameter exists and the corresponding value has been written. </dd></dl>

</div>
</div>
<a id="a10b58c61c35aa39a839f3876508810d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a10b58c61c35aa39a839f3876508810d5">&#9670;&nbsp;</a></span>getQueryParameterCount()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t httpsserver::ResourceParameters::getQueryParameterCount </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>unique</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the number of query parameters. </p>
<p>Query parameters are key-value pairs that are appended to the URI after a question mark.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unique</td><td>If true, return the number of unique keys (using the same key multiple times is counted only once). False by default, as checking for uniqueness is not efficient. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of query parameters </dd></dl>

</div>
</div>
<a id="ad9418179f1ad08593ec0801af1888d5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad9418179f1ad08593ec0801af1888d5c">&#9670;&nbsp;</a></span>isQueryParameterSet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool httpsserver::ResourceParameters::isQueryParameterSet </td>
          <td>(</td>
          <td class="paramtype">std::string const &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks whether a specific HTTPS query parameter is set. </p>
<p>Query parameters are key-value pairs that are appended to the URI after a question mark.</p>
<p>If the key exists (either as a value-less parameter or with a value), the function returns true.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The parameter to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true iff the parameter exists </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/home/frank/Projekte/esp32/https_server/esp32_https_server/src/<a class="el" href="ResourceParameters_8hpp_source.html">ResourceParameters.hpp</a></li>
<li>/home/frank/Projekte/esp32/https_server/esp32_https_server/src/ResourceParameters.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacehttpsserver.html">httpsserver</a></li><li class="navelem"><a class="el" href="classhttpsserver_1_1ResourceParameters.html">ResourceParameters</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
